Update the spec for TwitterPublishAgent.

Make public_tweet() return an object with an id attribute.

Akinori MUSHA 10 anni fa
parent
commit
ef81624aee
1 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. 5 2
      spec/models/agents/twitter_publish_agent_spec.rb

+ 5 - 2
spec/models/agents/twitter_publish_agent_spec.rb

@@ -22,7 +22,10 @@ describe Agents::TwitterPublishAgent do
22 22
     @event.save!
23 23
 
24 24
     @sent_messages = []
25
-    stub.any_instance_of(Agents::TwitterPublishAgent).publish_tweet { |message| @sent_messages << message}
25
+    stub.any_instance_of(Agents::TwitterPublishAgent).publish_tweet { |message|
26
+      @sent_messages << message
27
+      OpenStruct.new(:id => 454209588376502272)
28
+    }
26 29
   end
27 30
 
28 31
   describe '#receive' do
@@ -53,4 +56,4 @@ describe Agents::TwitterPublishAgent do
53 56
       @checker.reload.should_not be_working # More time has passed than the expected receive period without any new events
54 57
     end
55 58
   end
56
-end
59
+end